import '../../model/jxgzp.dart';

import '../../model/user.dart';

class JxgzpAuthority{

  static bool SdZby(User u1){
       //if(u1.Authority.indexOf("水调值班员")>-1)
       //return true;
       return false;
  }

  static bool DcZby(User u1){
       //if(u1.Authority.indexOf("电厂值班员")>-1)
       //return true;
       
       return false;
  }

  static bool IfQianZi(JXGZP s1, User u1){
        //添加签字规则验证
       if(s1.State==0 && s1.BMUserID==u1.Guid)
       return true;

      if(s1.State==1 && (s1.DCUserID==u1.Guid||s1.SDUserID==u1.Guid))
       return true;

 if(s1.State==2 && (s1.DCLDUserID==u1.Guid||s1.SDLDUserID==u1.Guid||s1.GCBLDUserID==u1.Guid))
       return true;

     

       return false;

  }


   static String QianZiTitle(JXGZP s1, User u1){
       
      if(s1.BMUserID==u1.Guid){
             return "工作票审核";
       }

        if(s1.DCUserID==u1.Guid){
             return "电厂会签";
       }

       if(s1.SDUserID==u1.Guid){
             return "水调中心会签";
       }

       if(s1.SDLDUserID==u1.Guid){
             return "水调中心分管领导签字";
       }

       if(s1.DCLDUserID==u1.Guid){
             return "电厂分管领导签字";
       }

       if(s1.GCBLDUserID==u1.Guid){
             return "监测中心分管领导签字";
       }

     

       return "签字版";

  }


  static bool IfQianZi2(JXGZP s1, User u1){
      
       if(s1.State==5 && s1.HZUserID==u1.Guid){
            return true;
       }

       return false;

  }


   static bool IfHuiZhi(JXGZP s1, User u1){

         
      //if(s1.BMIfOK && s1.DCIfOK && s1.GCBIfOK && s1.LDIfOK && DcZby(u1)&&s1.State==3)
      //return true;
      return false;
   }


}